package com.jdyinfo.ic.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jdyinfo.ic.mysql.entity.UpTownPeriod;
import com.jdyinfo.ic.mysql.mapper.UpTownPeriodMapper;

@Service("upTownPeriodService")
public class UpTownPeriodService {
	@Autowired
	UpTownPeriodMapper upTownPeriodMapper;
	
	public List<UpTownPeriod> findUpTownPeriod(int upTownId) {
		return upTownPeriodMapper.findUpTownPeriodByUpTownId(upTownId);
	}
	
	public int createUpTownPeriod(UpTownPeriod upTownPeriod) {
		return upTownPeriodMapper.insertOne(upTownPeriod);
	}
	
	public int updateUpTownPeriod(UpTownPeriod upTownPeriod) {
		return upTownPeriodMapper.updateOne(upTownPeriod);
	}
	
	public int deleteUpTownPeriod(int id) {
		return upTownPeriodMapper.deleteOne(id);
	}
	
}
